/**********************************************************************************************************
*	© 2010 Autodata Solutions Company. All Rights Reserved
*	This source code is the confidential and proprietary information of Autodata Solutions Company.
*	The user shall not, in whole or in part, copy, publish, disclose or make any use of this source code 
*	without the prior written consent of Autodata Solutions Company.
*
*	Author(s)	: Chris Raposo
*	Purpose		: Add page functionality for compare photos
* 	Version		: 1.0
*
* 	Namespace	: 
*********************************************************************************************************/

(function() {
    var EVENTS = net.autodata.EventBus.EVENTS;

    Ext.onReady(function() {
        var session = net.autodata.Session.getInstance();
        var eb = net.autodata.EventBus.getInstance();

        var ptb = new net.autodata.compare.toolbars.PageToolbar({
            viewCfg: { activeKey: 'photos' },
            renderTo: 'comparetoppanel-wrap'
        });

        var cvp = new net.autodata.compare.CompareVehiclesPanel({
            plugins: [
		        new net.autodata.compare.plugins.CompareVehiclesEventBus(),
		        new net.autodata.compare.plugins.CompareVehiclesNavigation(),
			    new net.autodata.compare.plugins.CompareVehiclesColourPicker()
	        ],

            renderTo: 'comparevehiclepanel-wrap',

            storeCfg: {
                proxy: new net.autodata.compare.data.CompareVehiclesSessionProxy()
            },

            view: new net.autodata.compare.CompareVehiclesPhotoView()
        });

        var pp = new net.autodata.compare.photos.PhotosPanel({
            renderTo: 'comparephotospanel-wrap',
            emptyText: ASC.message('net.autodata.compare.photos.emptyText'),
            plugins: [
				new net.autodata.compare.photos.plugins.PhotosPanelEventBusConnector(),
				new net.autodata.compare.photos.plugins.PhotosPanelPhotoWindowConnector()
			]
        });

        var ds = net.autodata.modelwalk.data.YearMakeModelDataStore.getInstance();
        ds.load();

        eb.fireEvent(EVENTS.READY);
    });
})();